{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport { useStyleRegister } from '@ant-design/cssinjs';\nimport { useContext } from 'react';\nimport { genCommonStyle, genLinkStyle } from '../../style';\nimport { ConfigContext } from '../../config-provider/context';\nimport { mergeToken, statisticToken, useToken } from '../internal';\nexport default function genComponentStyleHook(component, styleFn, getDefaultToken) {\n  return function (prefixCls) {\n    var _useToken = useToken(),\n      _useToken2 = _slicedToArray(_useToken, 3),\n      theme = _useToken2[0],\n      token = _useToken2[1],\n      hashId = _useToken2[2];\n    var _useContext = useContext(ConfigContext),\n      getPrefixCls = _useContext.getPrefixCls,\n      iconPrefixCls = _useContext.iconPrefixCls;\n    var rootPrefixCls = getPrefixCls();\n    // Generate style for all a tags in antd component.\n    useStyleRegister({\n      theme: theme,\n      token: token,\n      hashId: hashId,\n      path: ['Shared', rootPrefixCls]\n    }, function () {\n      return [{\n        // Link\n        '&': genLinkStyle(token)\n      }];\n    });\n    return [useStyleRegister({\n      theme: theme,\n      token: token,\n      hashId: hashId,\n      path: [component, prefixCls, iconPrefixCls]\n    }, function () {\n      var _statisticToken = statisticToken(token),\n        proxyToken = _statisticToken.token,\n        flush = _statisticToken.flush;\n      var defaultComponentToken = typeof getDefaultToken === 'function' ? getDefaultToken(proxyToken) : getDefaultToken;\n      var mergedComponentToken = Object.assign(Object.assign({}, defaultComponentToken), token[component]);\n      var componentCls = \".\".concat(prefixCls);\n      var mergedToken = mergeToken(proxyToken, {\n        componentCls: componentCls,\n        prefixCls: prefixCls,\n        iconCls: \".\".concat(iconPrefixCls),\n        antCls: \".\".concat(rootPrefixCls)\n      }, mergedComponentToken);\n      var styleInterpolation = styleFn(mergedToken, {\n        hashId: hashId,\n        prefixCls: prefixCls,\n        rootPrefixCls: rootPrefixCls,\n        iconPrefixCls: iconPrefixCls,\n        overrideComponentToken: token[component]\n      });\n      flush(component, mergedComponentToken);\n      return [genCommonStyle(token, prefixCls), styleInterpolation];\n    }), hashId];\n  };\n}","map":{"version":3,"names":["useStyleRegister","useContext","genCommonStyle","genLinkStyle","ConfigContext","mergeToken","statisticToken","useToken","genComponentStyleHook","component","styleFn","getDefaultToken","prefixCls","theme","token","hashId","getPrefixCls","iconPrefixCls","rootPrefixCls","path","proxyToken","flush","defaultComponentToken","mergedComponentToken","Object","assign","componentCls","mergedToken","iconCls","antCls","styleInterpolation","overrideComponentToken"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/theme/util/genComponentStyleHook.js"],"sourcesContent":["import { useStyleRegister } from '@ant-design/cssinjs';\nimport { useContext } from 'react';\nimport { genCommonStyle, genLinkStyle } from '../../style';\nimport { ConfigContext } from '../../config-provider/context';\nimport { mergeToken, statisticToken, useToken } from '../internal';\nexport default function genComponentStyleHook(component, styleFn, getDefaultToken) {\n  return prefixCls => {\n    const [theme, token, hashId] = useToken();\n    const {\n      getPrefixCls,\n      iconPrefixCls\n    } = useContext(ConfigContext);\n    const rootPrefixCls = getPrefixCls();\n    // Generate style for all a tags in antd component.\n    useStyleRegister({\n      theme,\n      token,\n      hashId,\n      path: ['Shared', rootPrefixCls]\n    }, () => [{\n      // Link\n      '&': genLinkStyle(token)\n    }]);\n    return [useStyleRegister({\n      theme,\n      token,\n      hashId,\n      path: [component, prefixCls, iconPrefixCls]\n    }, () => {\n      const {\n        token: proxyToken,\n        flush\n      } = statisticToken(token);\n      const defaultComponentToken = typeof getDefaultToken === 'function' ? getDefaultToken(proxyToken) : getDefaultToken;\n      const mergedComponentToken = Object.assign(Object.assign({}, defaultComponentToken), token[component]);\n      const componentCls = `.${prefixCls}`;\n      const mergedToken = mergeToken(proxyToken, {\n        componentCls,\n        prefixCls,\n        iconCls: `.${iconPrefixCls}`,\n        antCls: `.${rootPrefixCls}`\n      }, mergedComponentToken);\n      const styleInterpolation = styleFn(mergedToken, {\n        hashId,\n        prefixCls,\n        rootPrefixCls,\n        iconPrefixCls,\n        overrideComponentToken: token[component]\n      });\n      flush(component, mergedComponentToken);\n      return [genCommonStyle(token, prefixCls), styleInterpolation];\n    }), hashId];\n  };\n}"],"mappings":";AAAA,SAASA,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,UAAU,QAAQ,OAAO;AAClC,SAASC,cAAc,EAAEC,YAAY,QAAQ,aAAa;AAC1D,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,UAAU,EAAEC,cAAc,EAAEC,QAAQ,QAAQ,aAAa;AAClE,eAAe,SAASC,qBAAqB,CAACC,SAAS,EAAEC,OAAO,EAAEC,eAAe,EAAE;EACjF,OAAO,UAAAC,SAAS,EAAI;IAClB,gBAA+BL,QAAQ,EAAE;MAAA;MAAlCM,KAAK;MAAEC,KAAK;MAAEC,MAAM;IAC3B,kBAGId,UAAU,CAACG,aAAa,CAAC;MAF3BY,YAAY,eAAZA,YAAY;MACZC,aAAa,eAAbA,aAAa;IAEf,IAAMC,aAAa,GAAGF,YAAY,EAAE;IACpC;IACAhB,gBAAgB,CAAC;MACfa,KAAK,EAALA,KAAK;MACLC,KAAK,EAALA,KAAK;MACLC,MAAM,EAANA,MAAM;MACNI,IAAI,EAAE,CAAC,QAAQ,EAAED,aAAa;IAChC,CAAC,EAAE;MAAA,OAAM,CAAC;QACR;QACA,GAAG,EAAEf,YAAY,CAACW,KAAK;MACzB,CAAC,CAAC;IAAA,EAAC;IACH,OAAO,CAACd,gBAAgB,CAAC;MACvBa,KAAK,EAALA,KAAK;MACLC,KAAK,EAALA,KAAK;MACLC,MAAM,EAANA,MAAM;MACNI,IAAI,EAAE,CAACV,SAAS,EAAEG,SAAS,EAAEK,aAAa;IAC5C,CAAC,EAAE,YAAM;MACP,sBAGIX,cAAc,CAACQ,KAAK,CAAC;QAFhBM,UAAU,mBAAjBN,KAAK;QACLO,KAAK,mBAALA,KAAK;MAEP,IAAMC,qBAAqB,GAAG,OAAOX,eAAe,KAAK,UAAU,GAAGA,eAAe,CAACS,UAAU,CAA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